<?php
// $Id$

/**
 * @file
 * Installation file for race
 */

function race_schema() {
  $schema['race'] = array(
    'description' => t('The table for race.'),
    'fields' => array(
    'nid' => array(
      'description' => t('The primary identifier for a node.'),
      'type' => 'serial',
      'unsigned' => TRUE,
      'not null' => TRUE),
    'vid' => array(
      'description' => t('The current {node_revisions}.vid version identifier.'),
      'type' => 'int',
      'unsigned' => TRUE,
      'not null' => TRUE,
      'default' => 0),
    'config' => array(
      'description' => t('The congif of this race node.'),
      'type' => 'text',
      'not null' => TRUE),
    'signup' => array(
      'description' => t('The signups for this race node.'),
      'type' => 'text',
      'not null' => TRUE),
    'assignment' => array(
      'description' => t('The assigments for this race node.'),
      'type' => 'text',
      'not null' => TRUE),
    'state' => array(
      'description' => t('The state for this race node.'),
      'type' => 'int',
      'size' => 'tiny',
      'not null' => TRUE,
      'default' => 0),
  ),      
  'unique keys' => array(
  'nid_vid' => array('nid', 'vid'),
      'vid' => array('vid')
      ),
      'primary key' => array('nid'),
      );
  return $schema;
}

function race_install() {
  // Create my tables.
  drupal_install_schema('race');
}

function race_uninstall() {
  // Drop my tables.
  drupal_uninstall_schema('race');
}
